Skip to content

Comments

Create Week9 Mission1, 2, 3#116

Merged
immhyemi merged 3 commits intomainfrom
wendy
Jun 2, 2025
Merged

Create Week9 Mission1, 2, 3#116
immhyemi merged 3 commits intomainfrom
wendy

Conversation

@immhyemi
Copy link
Collaborator

@immhyemi immhyemi commented May 29, 2025

📝 미션 번호

9주차 Misson 1,2,3

📋 구현 사항

  • redux를 활용한 playlist 제작
  • modalslice를 이용한 모달 제작
  • zustand를 활용한 playlist제작

📎 스크린샷

스크린샷 2025-05-28 213908
image

✅ 체크리스트

  • Merge 하려는 브랜치가 올바르게 설정되어 있나요?
  • 로컬에서 실행했을 때 에러가 발생하지 않나요?
  • 불필요한 주석이 제거되었나요?
  • 코드 스타일이 일관적인가요?

🤔 질문 사항

Copy link
Member

@hyesngy hyesngy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

정말 고생 많으셨습니다! 👏🏻👏🏻👏🏻

이번 주 워크북을 통해 Redux ToolkitZustand 두 가지 상태관리 라이브러리를 모두 다뤄보았습니다. 앞으로 프로젝트 복잡도나 규모에 따라 적절한 상태관리 도구를 선택할 수 있는 안목을 갖추게 되셨으면 좋겠습니다! 👍🏻👍🏻👍🏻

Comment on lines +1 to +14
import { configureStore } from '@reduxjs/toolkit';
import cartReducer from './cartslice';
import modalReducer from './modalslice';

const store = configureStore({
reducer: {
cart: cartReducer,
modal: modalReducer,
},
});

export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;
export default store; No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재 장바구니 데이터가 새로고침 시 초기화되고 있는데, Redux Toolkit의 redux-persist나 Zustand의 persist 미들웨어를 적용하여, 새로고침 후에도 장바구니 상태가 유지되도록 🚀Challenge 미션에 도전해 보시면 좋겠습니다!

Comment on lines +9 to +15
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<Provider store={store}>
<App />
</Provider>
</React.StrictMode>
); No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재 미션 3의 App.tsx 에서 Redux의 Provider로 감싸고 있는데, 미션 3에서는 Zustand로 상태 관리를 전환했기 때문에 이 부분은 제거해야 합니다. 또한, store.ts, cartSlice.ts, modalslice.ts 등 Redux 관련 파일들이 여전히 남아있는데, 프로젝트 구조를 명확하게 하기 위해 해당 파일들도 제거하는 것을 권장합니다!

Comment on lines +1 to +10
import { useDispatch, useSelector } from 'react-redux';
import { closeModal } from '../store/modalslice';
import { clearCart } from '../store/cartslice';
import type { RootState } from '../store/store';

const ConfirmModal = () => {
const dispatch = useDispatch();
const { isOpen, type } = useSelector((state: RootState) => state.modal);

if (!isOpen || type !== 'clearCart') return null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재 미션 3에서 장바구니는 Zustand로 관리하고 있지만, 모달은 아직 Redux로 관리하고 있어 혼재된 상태입니다. modalStore.ts (openModal/closeModal 액션 포함)를 생성하고, 모든 컴포넌트에서 Redux 훅을 Zustand 훅으로 교체해보세요!

@immhyemi immhyemi merged commit 1338784 into main Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants